package cn.rslee.java.demos.test

import org.apache.spark.SparkConf
import org.apache.spark.SparkContext

object Map {
  def main(args: Array[String]): Unit = {
    val sc = new SparkContext(new SparkConf().setAppName("ReduceByKey").setMaster("local"));
    val rdd = sc.parallelize(Array(1, 2, 3, 4), 1)
    rdd.map(x => {x * x}).foreach(println) // 1 4 9 16
  }
}